import {doPostJson, doPostQs, doGet} from './utils-v2'

/**
* 获取后台用户拥有的菜单数据
*/
export const getMenuData = () => {
  return doGet('/role-sys-menu/admin/all-menu', {})
}

/**
 * 获取所有的菜单数据
 */
export const getMenuDataAll = () => {
  return doGet('/role-sys-menu/admin/all', {})
}

/**
 * 获取指定角色的菜单数据
 * @param {}} roleId 
 */
export const getMenuDataByRoleId = (roleId) => {
  return doGet('/role-sys-menu/admin/role-menu/' + roleId, {})
}

/**
 * 根据父菜单查询子菜单
 * @param {*} params 
 */
export const getMenuByParentId = (params) => {
  return doPostJson('/sys-menu/admin/all-cond', params, {})
}

/**
 * 更新系统菜单的排序
 * @param {}} params 
 */
export const updateSysMenuOrder = (params) => {
  return doPostJson('/sys-menu/admin/batch-update', params, {})
}

/**
 * 批量保存角色菜单数据
 * @param {}} params 
 */
export const batchSaveMenuData = (params) => {
  return doPostJson('/role-sys-menu/admin/batch-save', params, {})
}
